var newsinfoModel = {
  getPageList: function(data, result, fail){
    $.ajax('/admin/newsinfo/page-list', {
      type: 'get',
      data: data,
      dataType: 'json',
      success: result,
      error: fail
    });
  },
  getInfo: function(data, result, fail){
    $.ajax('/admin/newsinfo/info', {
      type: 'get',
      data: data,
      dataType: 'json',
      success: result,
      error: fail
    });
  },
  create: function(data, result, fail){
    $.ajax('/admin/newsinfo/insert', {
      type: 'post',
      data: data,
      dataType: 'json',
      beforeSend: function () {
        $("#loadingMask").fadeIn();
      },
      complete: function () {
        $("#loadingMask").fadeOut();
      },
      success: result,
      error: fail
    });
  },
  update: function(data, result, fail){
    $.ajax('/admin/newsinfo/update', {
      type: 'post',
      data: data,
      dataType: 'json',
      beforeSend: function () {
        $("#loadingMask").fadeIn();
      },
      complete: function () {
        $("#loadingMask").fadeOut();
      },
      success: result,
      error: fail
    });
  },
  confirm: function(data, result, fail){
    $.ajax('/admin/newsinfo/update', {
      type: 'post',
      data: data,
      dataType: 'json',
      success: result,
      error: fail
    });
  },
  move: function(data, result, fail){
    $.ajax('/admin/newsinfo/move', {
      type: 'post',
      data: data,
      dataType: 'json',
      success: result,
      error: fail
    });
  },
  delete: function(data, result, fail){
    $.ajax('/admin/newsinfo/delete', {
      type: 'post',
      data: data,
      dataType: 'json',
      success: result,
      error: fail
    });
  },
  uploadPic1: function(data, result, fail){
    $.ajax('/admin/newsinfo/upload-pic1', {
      type: "post",
      data: data,
      dataType: 'json',
      processData: false,
      contentType: false,
      beforeSend: function () {
        $("#loadingMask").fadeIn();
      },
      complete: function () {
        $("#loadingMask").fadeOut();
      },
      success: result,
      error: fail
    });
  },
  removePic1: function(data, result, fail){
    var url = '/admin/newsinfo/remove-pic1';
    $.post(url, data, result).fail(fail);   
  },
  uploadPic2: function(data, result, fail){
    $.ajax('/admin/newsinfo/upload-pic2', {
      type: "post",
      data: data,
      dataType: 'json',
      processData: false,
      contentType: false,
      beforeSend: function () {
        $("#loadingMask").fadeIn();
      },
      complete: function () {
        $("#loadingMask").fadeOut();
      },
      success: result,
      error: fail
    });
  },
  removePic2: function(data, result, fail){
    var url = '/admin/newsinfo/remove-pic2';
    $.post(url, data, result).fail(fail);   
  },
  uploadFile1: function(data, result, fail){
    $.ajax('/admin/newsinfo/upload-file1', {
      type: "post",
      data: data,
      dataType: 'json',
      processData: false,
      contentType: false,
      beforeSend: function () {
        $("#loadingMask").fadeIn();
      },
      complete: function () {
        $("#loadingMask").fadeOut();
      },
      success: result,
      error: fail
    });
  },
  removeFile1: function(data, result, fail){
    var url = '/admin/newsinfo/remove-file1';
    $.post(url, data, result).fail(fail);   
  }
};